<template>
  <div>
    <WrsDialog :visible='dialogVisible' :footer='false' width='1200px' @cancel='dialogVisibleCancel' :title="'水费退款'">
      <template #dialog>
        <approvalForm v-if="atls===1" ref="approvalFormRef"></approvalForm>
        <approvalFormCopy v-if="atls===2" ref="approvalFormCopyRef"></approvalFormCopy>
      </template>
      <template #foot1>
        <a-button type="primary">提交</a-button>
      </template>
    </WrsDialog>
  </div>
</template>
<script setup>
import WrsDialog from "@/components/WrsDialog/index.vue";
import approvalForm from "./approvalForm.vue";
import approvalFormCopy from "./approvalFormCopy.vue";
import { reactive, h, ref, nextTick } from "vue";
const dialogVisible = ref(false)
const approvalFormRef = ref()
const approvalFormCopyRef = ref()
const atls = ref(1)
const modalInit = async (_atls = 1) => {
  atls.value = _atls
  dialogVisible.value = true
  nextTick(() => {
    if (atls.value === 1) {
      approvalFormRef.value.formState = {
        one: "1",
        result: 1,
        two: "1"
      }
    }
    if (atls.value === 2) {
      approvalFormCopyRef.value.formState = {
        one: "1",
        result: 1,
        two: "1"
      }
    }
  })
}

const dialogVisibleCancel = () => {
  dialogVisible.value = false
}


defineExpose({
  modalInit
});
</script>
<style lang='less' scoped>
.refundAmount {
  :deep(.ant-table-expanded-row-fixed) {
    padding: 0px 0px 12px 48px !important;
  }

  .header {
    font-size: 18px;
    font-weight: 700;
  }

  .title {
    font-size: 15px;
    padding: 10px 0;
    font-weight: 600;
  }

}
</style>